import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_ble_ota/flutter_ble_ota.dart';
import 'package:flutter_ble_ota/flutter_ble_ota_platform_interface.dart';
import 'package:flutter_ble_ota/flutter_ble_ota_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterBleOtaPlatform
    with MockPlatformInterfaceMixin
    implements FlutterBleOtaPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterBleOtaPlatform initialPlatform = FlutterBleOtaPlatform.instance;

  test('$MethodChannelFlutterBleOta is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterBleOta>());
  });

  test('getPlatformVersion', () async {
    FlutterBleOta flutterBleOtaPlugin = FlutterBleOta();
    MockFlutterBleOtaPlatform fakePlatform = MockFlutterBleOtaPlatform();
    FlutterBleOtaPlatform.instance = fakePlatform;

    expect(await flutterBleOtaPlugin.getPlatformVersion(), '42');
  });
}
